#! _*_ coding: utf8 _*_
from django.db import models
from django.contrib.auth.models import User


# Create your models here.

class Teacher(models.Model):
    """Teacher"""

    me = models.OneToOneField(User, on_delete=models.PROTECT, default=1)

    base_salary = models.IntegerField(default=0)        # 基础工资
    percentage_salary = models.FloatField(default=0)    # 提成百分比
    per_salary = models.IntegerField(default=0)         # 提成固定
    fee_per_student = models.FloatField(default=0)      # 每个学生每节课
    fee_per_class = models.TextField(default='30:0,45:0,60:0')        # 每节课的课时费，课时长:课时费，逗号分隔，如45:100,60:120，即45分钟每节课100元、60分钟每节课120元

    def __unicode__(self):
        return self.me.first_name
